package com.yhsimon.observer;

/**
 * 显示当前天气情况(可以理解成气象站自己的网站)
 *
 * @author： YHSimon
 * @date： 2021-10-18 20:39
 */
public class CurrentConditions {
    private float temperature;
    private float pressure;
    private float humidity;


    //更新 天气情况  是由WeatherData 来调用，使用的是推送模式
    public void update(float temperature, float pressure, float humidity) {
        this.temperature = temperature;
        this.pressure = pressure;
        this.humidity = humidity;
        display();
    }

    public void display() {
        System.out.println("**** Today mTemperature:" + temperature + "****");
        System.out.println("**** Today mPressure:" + pressure + "****");
        System.out.println("**** Today mHumidity:" + humidity + "****");
    }
}
